import React, { Component } from 'react'
import {Route,Switch,Redirect} from 'react-router-dom'

import About from './pages/About'
import Home from './pages/Home'
import Test from './pages/Test'
import MyNavLink from './component/MyNavLink'

import './App.css'

export default class App extends Component {
  render() {
    return (
      <div>
        <h3>React Router Demo</h3>
        <MyNavLink to="/about">About</MyNavLink>
        <MyNavLink to="/home">Home</MyNavLink>
        <Switch>
          <Route path="/about" component={About} />
          <Route  path="/home" component={Home} />
          <Route  path="/home" component={Test} />
          <Redirect to="/about"></Redirect>
        </Switch>
      </div>
    )
  }
}
